package myomi.funf;

import java.util.HashMap;
import java.util.Map;

public class Context {
	private Map<String, Object> variables = new HashMap<String, Object>();
	private Map<String, Flow> flows = new HashMap<String, Flow>();
	
	public void addFlow(String name, Flow flow) {
		flows.put(name, flow);
		flow.setContext(this);
	}
	
	public void setVariable(String name, Object value) {
		this.variables.put(name, value);
	}
	
	public Map<String, Object> getVariables() {
		return this.variables;
	}
	
	public void executeFlow(String name) {
		flows.get(name).execute();
	}
}
